package com.example.huayang.appdome.https;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;

/**
 * Created by WANG on 2017/11/23.
 * 网络请求公共类
 */

public class SharingNetWorkRequest {
    private static SharingNetWorkRequest instance;

    public static SharingNetWorkRequest getInstance(){
        if(instance == null){
            instance = new SharingNetWorkRequest();
        }
        return instance;
    }

    //网络请求样式
    public void text(){
        String Url = "";
        HttpHeaders headers = MandatoryHeaders.getInstance().mandatoryHeaders();  //必传头部
        HttpParams params = new HttpParams();  //根据后台要求选择
        params.put("","");
        OkGo.<String>post(Url).headers(headers).params(params).execute(new JsonCallback<String>() {
            @Override
            public void onSuccess(Response<String> response) {
                super.onSuccess(response);
            }
        });
    }
}
